package com.company.bookstore.service.book_module;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.company.bookstore.entities.book_module.Book;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author 姬深威
 * @since 2020-09-12
 */
public interface BookService extends IService<Book> {

    Book getBookById(Integer bookId);

    IPage<Book> getAllBooks(IPage<Book> page, Integer orderType, Integer from, Integer to);

    IPage<Book> getAllBooksForFront(IPage<Book> page, Integer orderType, Integer from, Integer to);

    IPage<Book> getBooksByCid(IPage<Book> page, Integer cId, Integer orderType, Integer from, Integer to);

    IPage<Book> getBooksByCidForFront(IPage<Book> page, Integer cId, Integer orderType, Integer from, Integer to);

    IPage<Book> searchBooks(IPage<Book> page, Integer type, Integer orderType, String str, Integer from, Integer to);

    IPage<Book> searchBooksForFront(IPage<Book> page, Integer type, Integer orderType, String str, Integer from, Integer to);

    Integer addBooks(Book book);

    Integer deleteBook(Integer bookId);

    Integer handleSelectedBooks(Integer type, Integer[] selection);

    void updateBook(Book book);

    Integer handleGrounding(Book book);

    List<String> getNames();

    List<Book> getNamesMapWithId(List<Integer> ids);
}
